from pwdlib import PasswordHash


def get_password_hash(password: str) -> str:
    """
    获取密码的哈希值
    """
    password_hash = PasswordHash.recommended()
    return password_hash.hash(password)


def verify_password(plain_password: str, hashed_password: str) -> bool:
    """
    校验密码是否正确
    """
    password_hash = PasswordHash.recommended()
    return password_hash.verify(plain_password, hashed_password)
